<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script type="text/javascript" src="static/vue.min.js"></script>
    <style>
        .tab_con {
            width: 500px;
            height: 350px;
            margin: 50px auto 0;
        }

        .tab_btns {
            height: 50px;
        }

        .tab_btns input {
            width: 100px;
            height: 50px;
            background: #ddd;
            border: 0px;
            outline: none;
        }

        .tab_btns .active {
            background: gold;
        }

        .tab_cons {
            height: 300px;
            background: gold;
        }

        .tab_cons div {
            height: 300px;
            line-height: 300px;
            text-align: center;
            display: none;
            font-size: 30px;
        }

        .tab_cons .current {
            display: block;
        }
    </style>
</head>

<body>
<div class="tab_con">
    <div class="tab_btns">
        <!--使用属性绑定 和点击事件  三元运算符 -->
        <input type="button" value="按钮一" v-bind:class="num==0?'active':''" @click="num=0">
        <input type="button" value="按钮二" :class="num==1 ?'active':''" @click="num=1">
        <input type="button" value="按钮三" :class="num==2?'active':''" @click="num=2">
    </div>
    <div class="tab_cons">
        <div :class="num==0 ?'current':''">按钮一对应的内容</div>
        <div :class="num==1 ?'current':''">按钮二对应的内容</div>
        <div :class="num==2 ?'current':''">按钮三对应的内容</div>
    </div>
</div>
<script>
    new Vue({
        el: ".tab_con",
        data: {
            num: 0
        },
        methods: {}
    })
</script>
</body>
</html>